package com.demo;

import java.util.ArrayList;
import java.util.Collections;

public class CollectionsDemo1 {
    public static void main(String[] args) {
        /*
        public static <T> boolean addAl1(Collection<T> c, T... elements)  批量添加元素
        public static void shuffle(List<?> list)                          打乱List集合元素的顺序
         */
        //1.创建集合对象
        ArrayList<String> list = new ArrayList<>();

        //2.批量添加
        Collections.addAll(list,"abcd","efg","hijk","lmn","opq","rst","uvw","xyz");

        //3.打印集合
        System.out.println(list);

        //4.打乱集合
        Collections.shuffle(list);
        System.out.println(list);
    }
}
